package com.ufo.id;

import java.util.UUID;

public class IdCreatorShow {
    public static void main(String[] args){
        uuid();
    }

    //uuid随机字符串，基于网卡、时间和随机数生成，最简单的id生成方法
    //uuid标准编码是32个字符，java会用短线将其分段。可用replaceAll("-","")得到32位
    public static String uuid(){
        String uuid = UUID.randomUUID().toString();
        System.out.println("uuid:"+uuid);
        System.out.println("uuid length：:"+uuid.length());
        return uuid;
    }

    public static String SnowFlake(){
        SnowFlake.setSnowId(1,2);
        return String.valueOf(SnowFlake.nextId());
    }
}
